package com.allen.config;

import com.p6spy.engine.common.P6Util;
import com.p6spy.engine.spy.appender.MessageFormattingStrategy;

/**
 * @program: spring-boot-demo
 * @className P6spySqlFormatter
 * @description:
 * @author: zp
 * @create: 2024-09-19 10:48
 * @Version 1.0
 **/
public class P6spySqlFormatter implements MessageFormattingStrategy {
    public P6spySqlFormatter() {
    }

    public String formatMessage(int connectionId, String now, long elapsed, String category, String prepared, String sql, String url) {
        return now + " | " + P6Util.singleLine(sql);
    }
}
